<style>
    div{
        text-align: center;
    }
</style>
<?php
// error_reporting(0);

include_once 'dbinfo.php';
$id=$_GET['id'];

include_once 'dbinfo.php';

$link = mysqli_connect($dbhost,$dbusername,$dbpassword,$dbname,$dbport);

mysqli_set_charset($link,"utf8");//设置字符集
date_default_timezone_set("PRC");//设置时区

$sql="select * from tb_articles where id=".$id;



$result=mysqli_query($link,$sql);
// echo $sql;

$row=mysqli_fetch_assoc($result);

if($row){

    echo "<div>";
    echo $row['title'];
    echo "</div>";
    echo "<div>";
    echo $row['content'];
    echo "</div>";
}else{
    echo '没有查询到结果';
    // echo $sql;
}

// mysqli_error($link);

mysqli_close($link);
?>
